<?php
namespace App\Services\User;

use App\Models\Article;
use App\Models\Star;

class GetStaredCountService {

    public static function handle($user_id) {
        if ($user_id == '380' || $user_id == '429' || $user_id == '362')
            return Article::where('user_id', $user_id)->sum('star_num');

        return Star::where('entity_user_id', $user_id)->count();
    }
}